#pragma once

#include <CompilerFeatures.h>

#include <lib3d/node/TextImpl.h>
#include <lib3d/hard/Manager.h>
#include <HardwareDependentObject.h>

namespace liba {
namespace lib3d {
namespace node {
namespace text {
class SymbolAtlas;
} // namespace text

struct SymbolAtlasTextImplPrivates;

class SymbolAtlasTextImpl
	: public TextImpl
	, public HardwareDependentObject<hard::Manager, hard::VertexBuffer>
{
public:
	SymbolAtlasTextImpl(text::SymbolAtlas* atlas);
	~SymbolAtlasTextImpl();

	virtual void render_to_list(hard::Hardware * hardware, TextRenderInfo* tri, hard::RenderList * render_list) LIBA_OVERRIDE;
	virtual float get_text_width(const std::wstring & text) LIBA_OVERRIDE;
	virtual float get_text_height() LIBA_OVERRIDE;
	virtual void text_data_changed() LIBA_OVERRIDE;
	virtual void change_valignment(VAlignment value) LIBA_OVERRIDE;

	virtual TextImpl * clone() LIBA_OVERRIDE;
protected:
	virtual void on_add_hardware(hard::Manager::hardware_type* ha) LIBA_OVERRIDE;
private:
	std::auto_ptr<SymbolAtlasTextImplPrivates> privates;
	friend struct SymbolAtlasTextImplPrivates;
};

} // namespace node
} // namespace lib3d
} // namespace liba